package com.polito.mad.bikeponyapp.persistence;




public class DeliveryItem implements Comparable<Integer>{

	private long id;
	private long deliveryId;
	private String address;
	private String additionalInfo;
	private int order;
	private double longitude;
	private double latitutde;
	private long estimatedTime;
	private boolean invalidPosition;
	private String imageFileName;
	
	private DeliveryItemType deliveryItemType;
	
	public long getDeliveryId() {
		return deliveryId;
	}
	public void setDeliveryId(long deliveryId) {
		this.deliveryId = deliveryId;
	}
	
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getAdditionalInfo() {
		return additionalInfo;
	}
	public void setAdditionalInfo(String additionalInfo) {
		this.additionalInfo = additionalInfo;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public int getOrder() {
		return order;
	}
	public void setOrder(int order) {
		this.order = order;
	}
	public DeliveryItemType getDeliveryItemType() {
		return deliveryItemType;
	}
	public void setDeliveryItemType(DeliveryItemType deliveryItemType) {
		this.deliveryItemType = deliveryItemType;
	}
	public double getLatitutde() {
		return latitutde;
	}
	public void setLatitutde(double latitutde) {
		this.latitutde = latitutde;
	}
	public double getLongitude() {
		return longitude;
	}
	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}
	public enum DeliveryItemType
	{
		PICKUP(0),
		DELIVERY(1);
		
		private final int type;
		private DeliveryItemType(int type) {
			this.type=type;
		}
		
		public static DeliveryItemType fromType(int type)
		{
			for(DeliveryItemType deliveryItemType:DeliveryItemType.values())
			{
				if(deliveryItemType.getType()== type)
					return deliveryItemType;
			}
			throw new IllegalStateException("no DeliveryItemType exists for the specified type");
		}
		public int getType()
		{
			return this.type;
		}
	}
	@Override
	public int compareTo(Integer another) {
		return order-another;
	}
	public long getEstimatedTime() {
		return estimatedTime;
	}
	public void setEstimatedTime(long estimatedTime) {
		this.estimatedTime = estimatedTime;
	}
	/*
	public List<double[]> getSteps() {
		return steps;
	}
	public void setSteps(List<double[]> steps) {
		this.steps = steps;
	}*/
	public boolean isInvalidPosition() {
		return invalidPosition;
	}
	public void setInvalidPosition(boolean invalidPosition) {
		this.invalidPosition = invalidPosition;
	}
	public void setImageFileName(String imageFileName) {
		this.imageFileName=imageFileName;
		
	}
	public String getImageFileName()
	{
		return this.imageFileName;
	}
	
}
